package com.study.studyfive.proxy;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author zhangwei
 * @version 1.0
 * @date 2023/9/16 12:55
 */
@Aspect
@Component
public class PermissionValidate {


    @Pointcut("@annotation(com.study.studyfive.proxy.LoginAction)")
    public  void   point () {
    }


    @Before("point ()")
    public void before (JoinPoint  joinPoint) {
        Object[] args = joinPoint.getArgs();
        String kind = joinPoint.getKind();
        Signature signature = joinPoint.getSignature();
        String s = joinPoint.toString();
        System.out.println("通过session或者redis 获取我们的用户token");
        System.out.println("通过token解析出用户id");
        System.out.println("再去查询是否有权限");

    }

}
